#pragma once

#include <exception>
#include <string>
#include <iostream>

enum ERROR_TYPE{
	DEFAULT,
	SPA_PARSE_ERROR,
	PQL_PARSE_ERROR
};

class CustomException : public std::exception {
private:
	std::string errorMessage; /**< A string containing the error message. */
	ERROR_TYPE errorType; /**< An enum containing the error type. */

	/**
	 * Gets the string format of the error code
	 * @return returns the string of the error code
	 */
	std::string getErrorLabel();

public:
	/**
	 * Creates a new CustomException
	 * @param error the type of error given in the enum ERROR_TYPE.
	 * @param message the exception message.
	 */
	CustomException(ERROR_TYPE error, std::string message);

	/**
	 * Gets the exception message
	 * @return returns the exception message
	 */
	std::string getMessage();

	/**
	 * Gets the error type
	 * @return returns the error type
	 */
	ERROR_TYPE getErrorType();

	/**
	 * Prints the exception error type and message
	 */
	void printMessage();
};